package com.ioday02test;

import java.io.*;

public class CopyTest2Buffered {
    public static void main(String[] args) throws IOException {
        long start = System.currentTimeMillis();
        FileInputStream fis = new FileInputStream("12.jpg");
        BufferedInputStream bis = new BufferedInputStream(fis);
        FileOutputStream fos = new FileOutputStream("15.jpg");
        BufferedOutputStream bos = new BufferedOutputStream(fos);
        int temp;
        while ((temp = bis.read())!= -1){
            bos.write(temp);
        }
        System.out.println("复制完成");
        bos.close();
        bis.close();
        long end = System.currentTimeMillis();
        System.out.println(end - start);
    }
}
